public class Emploudd {
    public  String name;
    public  double salary;
    public  double subsidy;
    //计算所得税的方法p
    public  double calcincomeTax(){
        //this关键字表示当前对象引用
        double baseSalary = 3500;
        double totalMoney = this.salary+this.subsidy;
        double amount = 0.0;
        if (totalMoney<=3500){
            amount =0.0;

        }
        else{
            double extra = totalMoney-3500;
            if (extra>=0&&extra<=500){
                amount = extra*0.05;
            }
            else if(extra>=500&&extra<=2000){
                amount = extra*0.1;
            }
            else if(extra>=2000&&extra<=5000){
                amount = extra*0.15;
            }
            else if(extra>=5000&&extra<=20000){
                amount = extra*0.2;
            }
            else {
                amount = extra*0.3;
            }
        }
        double actualMoney = totalMoney - amount;
        return actualMoney;


    }


}
